//
//  PublicRepairHeaderView.m
//  PropertyMananger
//
//  Created by bh on 17/1/16.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "PublicRepairHeaderView.h"

@implementation PublicRepairHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.bgView = [[UIView alloc]init];
        [self.contentView addSubview:self.bgView];
        self.bgView.backgroundColor = [UIColor whiteColor];
        
        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW, 65));
        }];
        
        self.headerView = [[UIView alloc]init];
        [self.bgView addSubview:self.headerView];
        self.headerView.backgroundColor = BHColor(238, 238, 238);
        
        [self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.top.equalTo(self.bgView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW, 15));
        }];
        
        self.orderCodeLabel = [[UILabel alloc]init];
        [self.bgView addSubview:self.orderCodeLabel];
        
        self.orderCodeLabel.textColor = BHColor(51, 51, 51);
        self.orderCodeLabel.font = BHFont(15);
        self.orderCodeLabel.textAlignment = NSTextAlignmentLeft;
        
        [self.orderCodeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.top.equalTo(self.headerView.mas_bottom).with.offset(12.5);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 90, 25));
        }];
        
        
        self.iconImg = [[UIImageView alloc]init];
        [self.contentView addSubview:self.iconImg];
        self.iconImg.image = IMG(@"ico_new");
        
        [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.orderCodeLabel.mas_trailing).with.offset(0);
            make.top.equalTo(self.orderCodeLabel).with.offset(5);
            make.size.mas_equalTo(CGSizeMake(25, 20));
        }];
        
        UIImageView * arrowView = [[UIImageView alloc]init];
        [self.contentView addSubview:arrowView];
        arrowView.image = IMG(@"ico_work_order_next");
        
        [arrowView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self).with.offset(-15);
            make.top.equalTo(self.headerView.mas_bottom).with.offset(18);
            make.size.mas_equalTo(CGSizeMake(8, 14));
        }];
        
        UIView * lineView = [[UIView alloc]init];
        [self.bgView addSubview:lineView];
        lineView.backgroundColor = BHColor(230, 230, 230);
        
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(0);
            make.bottom.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW, 1));
        }];
        
        
    }
    return self;
}


@end
